using System;

using lucere.entity;

namespace lucere.index.read
{
    /// <summary>
    /// This stores a monotonically increasing set of <Term, TermInfo> pairs in a
    /// Directory.  Pairs are accessed either by Term or by ordinal position the set.  
    /// </summary>
    public interface ITermInfosReader : IDisposable
    {
        int SkipInterval { get; }
        int MaxSkipLevels { get; }

        /// <summary>
        /// Returns an enumeration of all the Terms and TermInfos in the set.
        /// </summary>
        /// <returns></returns>
        ISegmentTermEnumerator Terms { get; } 

        /// <summary>
        /// Returns the number of term/value pairs in the set.
        /// </summary>
        /// <returns></returns>
        long Size { get; } 

        /// <summary>
        /// Returns the TermInfo for a Term in the set, or null. 
        /// </summary>
        /// <param name="term"></param>
        /// <returns></returns>
        ITermInfo GetTermInfo(ITerm term);

        /// <summary>
        /// Returns the position of a Term in the set or -1. 
        /// </summary>
        /// <param name="term"></param>
        /// <returns></returns>
        long GetPosition(ITerm term);

        /// <summary>
        /// Returns an enumeration of terms starting at or after the named term.
        /// </summary>
        /// <param name="term"></param>
        /// <returns></returns>
        ISegmentTermEnumerator GetTerms(ITerm term);

    }
}